version: '3.8'
services:
  mysql:
    image: mysql:8.0.33
    container_name: mysql
    restart: unless-stopped
    environment:
      MYSQL_USER: mysql
      MYSQL_PASSWORD: password
      MYSQL_DATABASE: bbq
      MYSQL_ROOT_PASSWORD: password
    ports:
      - 5432:5432
    command: --default-authentication-plugin=mysql_native_password --secure-file-priv=/data
    healthcheck:
      test: ["CMD-SHELL", "mysqladmin", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - mysql-network
    volumes:
      - ./bbq.sql:/docker-entrypoint-initdb.d/bbq.sql

networks:
  mysql-network:
    driver: bridge
